package com.suitsoft.ut.web.select;

import java.util.List;

import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ActionSupport;
import com.suitsoft.ut.entity.base.Student;
import com.suitsoft.ut.entity.thesis.Thesis;
import com.suitsoft.ut.service.base.StudentManager;
import com.suitsoft.ut.service.thesis.ThesisManager;
import com.suitsoft.ut.web.CrudActionSupport;

/**
 * 未确定的题目和未选题的学生
 *@author Suineg
 */
@Results({@Result(name = CrudActionSupport.RELOAD,location="no-select",type="redirect")})
public class NoSelectAction extends ActionSupport{
	/**
	 * 
	 */
	private static final long serialVersionUID = 4808248468636543470L;
	/** 日志输出对象 */
	protected final Logger logger = LoggerFactory.getLogger(getClass());
	
	private StudentManager studentManager;
	private ThesisManager thesisManager;
	
	/** 未选题的学生集合 */
	private List<Student> noSelectStudents;
	/** 没确定学生的题目  */
	private List<Thesis> noSelectThesis;
	
	
	
	@Override
	public String execute() throws Exception {
		noSelectStudents =studentManager.findByNoThesis();
		noSelectThesis = thesisManager.findNoStudent();
		return CrudActionSupport.RELOAD;
	}
	@Autowired
	public void setStudentManager(StudentManager studentManager) {
		this.studentManager = studentManager;
	}
	public List<Student> getNoSelectStudents() {
		return noSelectStudents;
	}
	public void setNoSelectStudents(List<Student> noSelectStudents) {
		this.noSelectStudents = noSelectStudents;
	}
	public List<Thesis> getNoSelectThesis() {
		return noSelectThesis;
	}
	public void setNoSelectThesis(List<Thesis> noSelectThesis) {
		this.noSelectThesis = noSelectThesis;
	}
	@Autowired
	public void setThesisManager(ThesisManager thesisManager) {
		this.thesisManager = thesisManager;
	}
	
}

